package com.spring.service;

import com.spring.dao.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {
    //给udao赋值，相当于ref
    @Autowired  //bytype
//    @Resource  byname+bytype 就是说有名称的时候按名称赋值，乜有的时候按类型赋值
    private UserDAO udao;
    public void print(){
        System.out.println("userService的方法");
        udao.print();
    }
}
